package com.interfacedemo;

public class Test {
    public static void main(String[] args) {
        Student student1 = new Student("张三",15);
        Student student2 = new Student("里斯",12);
        System.out.println(student1.getAge());
        System.out.println(student2.getAge());

        StudentInterface student = new StudentInterfaceImpl();
        Student[] students = {student1,student2};
        for (Student studentEvery : students) {
            student.eat(studentEvery);
            student.sleep(studentEvery);
        }

    }
}
